<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/crs.css">
        <title>Gutachter-Webseite</title>
    </head>
    <body>
        <span class="username">Benutzer: ${name}</span>

        <span class="roles">
            <form action="Main" method="POST">
                <select name="action" onchange="this.form.submit()">
                    <c:forEach items="${roles}" var="role">
                        <option value="${role}" <c:if test="${fn:containsIgnoreCase(role, 'reviewer')}">selected="true"</c:if>>${role}</option>
                    </c:forEach>
                </select>
            </form>
        </span>

        <br/> 
        
        <c:choose>
            <c:when test="${empty paperList}">
            <p>Momentan sind keine Paper zu bewerten!</p>
            </c:when>
            <c:otherwise>
            <form action="ReviewerView" method="post">
                Zu bewertende Paper:
                <br/>
                <select name="paperlist" size="5" >
                    <c:forEach items="${paperList}" var="paper">
                        <option>${paper.getFilename()}</option>
                    </c:forEach>
                </select>

                <br/>

                <p>
                    Note: 
                    <input type="radio" name="grade" value="1" checked="checked">1 
                    <input type="radio" name="grade" value="2">2 
                    <input type="radio" name="grade" value="3">3 
                    <input type="radio" name="grade" value="4">4 
                    <input type="radio" name="grade" value="5">5
                </p>

                <p>
                    Textuelle Bewertung: <br/>
                    <textarea name="report" cols="50" rows="10">Gründe, für die Bewertung...
                    </textarea>
                </p>

                <p>
                    <input type="radio" name="passed" value="true">Bestanden
                    <input type="radio" name="passed" value="false" checked="checked">Nicht Bestanden
                </p>

                <p>
                    <input type="hidden" name="action" value="review"/>
                    <input type="submit" value="Begutachten">
                </p>
            </form>
            </c:otherwise>
        </c:choose>
        
        
        
        <form action="LoginPage">
            <input type="hidden" name="action" value="logout"/>
            <input type="submit" value="Logout"/>
        </form>
    </body>
</html>
